package com.tengju.data.domain.model.report;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum DataNameEnum {
    ACHIEVEMENT("black_shipment_month_snapshot","出货额",false),
    RELATION("black_user_info_snapshot","黑卡关系",false),
    STAR_NOTICE("bigdata_star_change_notice_record","星级变更提醒",false),
    STAR_INVITE("bigdata_star_change_notice_record_invite","星级变更邀请",false),
    USER_STAR("data_star_month_snapshot","星级等级",false),
    ACTIVITY_66("bigdata_activity_sale_money","66活动",false),
    ACHIEVEMENT_RISK("black_shipment_month_risk","风控对比出货额",false),
    ;

    String name;
    String desc;

    @Deprecated
    boolean isExternal;

    DataNameEnum(String name, String desc,boolean isExternal) {
        this.name = name;
        this.desc = desc;
        this.isExternal = isExternal;
    }

    public static DataNameEnum parseByName(String name) {
        return Arrays.stream(DataNameEnum.values())
                .filter(k -> k.getName().equals(name))
                .findFirst().orElse(null);
    }

}
